<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>{&SITE_TITLE}</title>
  <link href="__PUBLIC__/admin/css/layout.css" rel="stylesheet" type="text/css" />
  <script type="text/javascript" src="__PUBLIC__/js/jquery.js" ></script>
<script type="text/javascript">
function check(){
	if(!confirm('确认修改该，如果删除分类，现有分类将处于无分类状态')){
		   return false;
	}
	return true;
}
function deleteSmallTypeItem(id){
	if(check()){
		$.post( '__APP__/Admin/doEditSmallTypeItem/',{id:id},function(result){
		    if(result == -1){
		    	 alert('删除失败');
		    	 return ;
			}
			if(result == 1){
                $('#type'+id).remove();
			}
		})
	}
}
var i = 0;
function addItem(){
	 var item = '<div id="more'+i+'">\
	              <input name="more[]"/><input type="button" onclick="deleteMoreItem('+i+')" class="button" value="删除" />\
	            </div>';
	 i++;
	 $('#item').append(item);
}
function deleteMoreItem(id){
	$('#more'+id).remove();
	i--;
}
</script>
    <script type="text/javascript">
    </script>
        </head>
    <body>
        <div id="container">
                                <div class="tab">
                                <ul>
                                        <li> <a href="__URL__/index/">招贴种类管理</a></li>
                                        <li><a href="__URL__/adminPoster/">招贴管理</a></li>
                                        <li> <a href="__URL__/add/">增加招贴</a></li>
                                </ul>
                        </div>
         
         
         
      <form action = "__URL__/doEditSmallType" method="post" onsubmit="return check();">
                <table class="tableborder" width="100%">
                <tbody>
                    <tr class="top">
                        <td class="border" colspan="2"></td>
                    </tr>
                    <tr>
                        <th class="header" colspan="2">修改招贴板小分类</th>
                    </tr>
                    <tr class="label">
                        <th>说明</th>
                        <th>设置</th>
                    </tr>
                    <tr class="cell">
                        <td class="altbg1" style="width:30%;">
                            <b>分类名</b>
                        </td>
                            <td class="altbg2"><input name="name" class="txt" value="{$label}"/></td>
                    </tr>
                    <tr class="cell">
                        <td class="altbg1">
                            <b>分类数据</b>
                            <br />
                            <span class="smalltxt" id="explain">留空为删除这个选项，注意，已有数据的分类将清空</span>
                        </td>
                            <td class="altbg2" id="item">
	                            <volist name="smallType" id="vo">
		                            <div id="type{$vo.id}">
		                               <input name="type[{$vo.id}]" value={$vo.name} /><input type="button" onclick="deleteSmallTypeItem({$vo.id})" class="button" value="删除" />
		                            </div>
	                            </volist>
                            </td>
                    </tr>
                    <tr>
                        <td class="footer" colspan="2">
                            <input type="button" class="submit" onclick="addItem();" value="添加新的成员" />
                            <input type="submit" class="submit" value="提交" />
                        </td>
                    </tr>
                    </tbody>
            </table>
      </form>
        </div>
    </body>
</html>
